﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HttpUploader4.demoSql2005.db
{
	/// <summary>
	/// 只负责更新数据表中文件上传进度信息。
	/// 调用位置：HttpUploader.js中HttpUploader_Process事件
	/// 更新记录：
	///		2012-4-18 创建
	/// </summary>
	public partial class ajax_process : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			string suid = Request.Form["uid"];
			string sfid = Request.Form["fid"];
			string sPostedLen = Request.Form["PostedLength"];
			string percent = Request.Form["Percent"];

			if (null == suid
				|| null == sfid
				|| null == sPostedLen
				|| null == percent)
			{
				return;
			}

			int uid = Convert.ToInt32(suid);
			int fid = Convert.ToInt32(sfid);
			long postedLength = Convert.ToInt64(sPostedLen);

			//更新数据表中文件上传进度信息
			HttpUploaderDB db = new HttpUploaderDB();
			db.UpdateProgress(uid, fid, postedLength, postedLength, percent);
		}
	}
}
